#pragma once

#include <d3d10.h>
#include "EnginePointer.h"
#include "VertexTypes.h"
#include "SpotLightComponent.h"
#include "ICameraComponent.h"
#include "Model.h"
#include "ModelLoader.h"

class SpotLightRenderer
{
public:
	SpotLightRenderer(void);
	~SpotLightRenderer(void);

	HRESULT LoadGraphicsContent(EnginePointer<ModelLoader> pModelLoader, EnginePointer<ID3D10Device>& pDevice, EnginePointer<ID3D10EffectPool>& pCommonPool);
    void UnloadGraphicsContent();
	HRESULT Render(list<EnginePointer<SpotLightComponent>>::iterator lightsBegin, list<EnginePointer<SpotLightComponent>>::iterator lightsEnd);
private:
	EnginePointer<Model> coneModel;
	EnginePointer<ID3D10Device> pDevice;
	ID3D10Effect* pEffect;
	ID3D10InputLayout* pVertexLayout;
	ID3D10EffectTechnique* pTechnique;
	ID3D10EffectVectorVariable* pColorVariable;
	ID3D10EffectVectorVariable* pLightPositionVariable;
	ID3D10EffectMatrixVariable* pWorldVariable;
	ID3D10EffectScalarVariable* pRadiusVariable;
	ID3D10EffectScalarVariable* pAngleCosineVariable;
	ID3D10EffectScalarVariable* pDecayExponentVariable;
	ID3D10EffectVectorVariable* pNormalLookAtVariable;
	HMODULE contentModule;
};
